Acceleration management node, acceleration node, client, and method

ABSTRACT

Embodiments of the present application provide an acceleration management node. The acceleration management node separately receives acceleration device information of all acceleration devices. The acceleration device information includes an acceleration type and an algorithm type. The acceleration management node obtains an invocation request from a client. The invocation request is used to invoke an acceleration device to accelerate a service of the client, and the invocation request includes a target acceleration type and a target algorithm type. The acceleration management node queries the acceleration device information to determine, from all the acceleration devices of the at least one acceleration node, a target acceleration device matching the invocation request. The acceleration management node further instructs a target acceleration node to respond to the invocation request.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/937,864, filed on Mar. 28, 2018, now U.S. Pat. No. 10,628,190, whichis a continuation of International Patent Application No.PCT/CN2016/100137, filed on Sep. 26, 2016. The International PatentApplication claims priority to Chinese Patent Application No.201510628762.0, filed on Sep. 28, 2015. All of the afore-mentionedpatent applications are hereby incorporated by reference in theirentireties.

TECHNICAL FIELD

The present application relates to the field of virtualizationtechnologies, and in particular, to an acceleration management node, anacceleration node, a client, and a method.

BACKGROUND

To shorten an execution time of an application program and improve therunning efficiency, some services (or functions) in the program may beallocated to a hardware acceleration device for execution. Because thehardware acceleration device runs fast, the execution time of theapplication program can be shortened. Common accelerated servicesinclude encryption, decryption, compression, decompression, audio andvideo encoding and decoding, and the like. Hardware acceleration devicesinclude a processor that provides special instructions, and otherperipheral component interconnect (PCI) devices that can provide anacceleration function, such as a graphics processing unit (GPU) and afield programmable gate array (FPGA).

At present, network function virtualization (NFV) is proposed. Thepurpose of the NFV is to implement some network functions ingeneral-purpose high-performance servers, switches, and storage devicesthrough virtualization. In a NFV evolution scenario, a network devicethat is based on special-purpose hardware may be deployed on ageneral-purpose server by using the virtualization technology. Aconventional combination of “embedded software+special-purpose hardware”is evolved into a combination of “software+general-purpose hardware.” Inorder to implement hardware generalization, a network function (NF)program needs to be separated from conventional special-purpose hardwareto form a virtualization network function (VNF) program, so that theconventional special-purpose hardware becomes general-purpose NFVhardware.

However, after forming the general-purpose NFV hardware, how toaccurately schedule the NFV hardware according to a service requirementof an application program becomes a problem to be resolved.

SUMMARY

Embodiments of the present application provide an accelerationmanagement node, an acceleration node, a client, and a method, appliedto a virtualization scenario, so that an acceleration device can beaccurately invoked according to a service requirement of a client.

According to a first aspect, an embodiment of the present applicationprovides an acceleration management node. The acceleration managementnode includes a receiving unit, configured to separately receive, fromat least one acceleration node, acceleration device information of allacceleration devices of the acceleration node. Each acceleration nodeincludes at least one acceleration device. The acceleration deviceinformation includes an acceleration type and an algorithm type. Theacceleration management node also includes an obtaining unit, configuredto obtain an invocation request from a client. The invocation request isused to invoke an acceleration device to accelerate a service of theclient, and the invocation request includes a target acceleration typeand a target algorithm type. The acceleration management node furtherincludes an allocation unit, configured to query the acceleration deviceinformation to determine, from all the acceleration devices of the atleast one acceleration node, a target acceleration device matching theinvocation request. The acceleration management node additionallyincludes an instruction unit, configured to instruct a targetacceleration node on which the target acceleration device is located torespond to the invocation request. The acceleration management nodeinvokes an acceleration device according to acceleration deviceinformation in each acceleration node and may allocate, according to arequirement of an application program of a client and an accelerationtype and an algorithm type of each acceleration device, a correspondingacceleration device to the application program, so as to meet a servicerequirement.

In a first possible implementation manner of the first aspect, theallocation unit is configured to query the acceleration deviceinformation to determine, from all the acceleration devices of the atleast one acceleration node, the target acceleration device whoseacceleration type and algorithm type are respectively the same as thetarget acceleration type and the target algorithm type. When invoking anacceleration device according to acceleration device information in eachacceleration node, the acceleration management node performs invocationaccording to an acceleration type, an algorithm type, and accelerationbandwidth of each acceleration device, so as to ensure that bandwidth ofthe acceleration device can meet a service requirement, therebyimplementing accurate invocation.

With reference to the first aspect or the first possible implementationmanner of the first aspect, in a second possible implementation manner,the acceleration information further includes acceleration bandwidth,and the acceleration bandwidth includes total bandwidth and occupiedbandwidth; the invocation request further includes target accelerationbandwidth. The allocation unit is specifically configured to query theacceleration device information to determine at least one candidateacceleration device whose acceleration type and algorithm type arerespectively the same as the target acceleration type and the targetalgorithm type and whose remaining bandwidth is greater than or equal tothe target acceleration bandwidth. The allocation unit determines one ofthe at least one candidate acceleration device as the targetacceleration device, where the remaining bandwidth is obtained bycalculation according to the total bandwidth and the occupied bandwidth.

With reference to the second possible implementation manner of the firstaspect, in a third possible implementation manner, the accelerationdevice information further includes non-uniform memory accessarchitecture (NUMA) information. The invocation request further includestarget NUMA information. The allocation unit is specifically configuredto query the acceleration device information to determine at least onecandidate acceleration device whose acceleration type and algorithm typeare respectively the same as the target acceleration type and the targetalgorithm type, whose remaining bandwidth is greater than or equal tothe target acceleration bandwidth, and whose NUMA information isconsistent with the target NUMA information. The allocation unitdetermines one of the at least one candidate acceleration device as thetarget acceleration device, where the remaining bandwidth is obtained bycalculation according to the total bandwidth and the occupied bandwidth.

With reference to either of the second possible implementation mannerand the third possible implementation manner of the first aspect, in afourth possible implementation manner, the allocation unit isspecifically configured to: when there is one candidate accelerationdevice, determine the candidate acceleration device as the targetacceleration device.

With reference to any one of the second to fourth possibleimplementation manners of the first aspect, in a fifth possibleimplementation manner, the allocation unit is specifically configuredto: when there is a plurality of candidate acceleration devices,determine a first acceleration device having maximum remaining bandwidthfrom the plurality of candidate acceleration devices according to theacceleration bandwidth. If there is one first acceleration device, theallocation unit determines the first acceleration device as the targetacceleration device.

With reference to the fifth possible implementation manner of the firstaspect, in a sixth possible implementation manner, the allocation unitis specifically configured to: when there is a plurality of firstacceleration devices having the maximum remaining bandwidth, determine asecond acceleration device having a maximum VF quantity from theplurality of first acceleration devices according to the VF quantity. Ifthere is one second acceleration device, the allocation unit uses thesecond acceleration device as the target acceleration device.

With reference to the sixth possible implementation manner of the firstaspect, in a seventh possible implementation manner, the allocation unitis specifically configured to: when there is a plurality of secondacceleration devices having the maximum VF quantity, use a secondacceleration device first found as the target acceleration deviceaccording to a time sequence of querying the acceleration deviceinformation.

With reference to any one of the first aspect or the first to seventhpossible implementation manners of the first aspect, in an eighthpossible implementation manner, the instruction unit is specificallyconfigured to send configuration instruction message to the targetacceleration node. The configuration instruction message instructs thetarget acceleration node to respond to the invocation request. Theconfiguration instruction message indicates an acceleration type and analgorithm type of the target acceleration device matching the invocationrequest, or the configuration instruction message indicates anacceleration type, an algorithm type, and acceleration bandwidth of thetarget acceleration device.

With reference to any one of the first aspect or the first to eighthpossible implementation manners of the first aspect, in a ninth possibleimplementation manner, the acceleration management node further includesa storage unit, configured to store the acceleration device information.

With reference to any one of the second to ninth possible implementationmanners of the first aspect, in a tenth possible implementation manner,the storage unit is further configured to: update previously storedacceleration device information corresponding to the target accelerationdevice according to the target acceleration bandwidth; and record anallocation result of the instruction unit.

With reference to any one of the first aspect or the first to tenthpossible implementation manners of the first aspect, in an eleventhpossible implementation manner, the acceleration management node furtherincludes a releasing unit. The releasing unit is configured to obtain arelease request from the client for releasing the target accelerationdevice, and invoke the target acceleration node to release the targetacceleration device.

With reference to the eleventh possible implementation manner of thefirst aspect, in a twelfth possible implementation manner, the releasingunit is configured to: when detecting that the service of the clientbecomes abnormal, find the target acceleration device according to theallocation result recorded by the storage unit. The releasing unitinvokes the target acceleration node to release the target accelerationdevice.

With reference to any one of the ninth to twelfth possibleimplementation manners of the first aspect, in a thirteenth possibleimplementation manner, the storage unit is further configured to set theallocation result to invalid.

According to a second aspect, an embodiment of the present applicationprovides an acceleration node. The acceleration node includes an agentunit, a driver, and at least one acceleration device. The driver isconfigured to drive the at least one acceleration device. The at leastone acceleration device is configured to provide a hardware accelerationfunction. The agent unit is configured to: invoke the driver toseparately query the at least one acceleration device to obtainacceleration device information of each acceleration device, where theacceleration device information includes an acceleration type and analgorithm type; and report the acceleration device information to anacceleration management node. The acceleration node reports accelerationdevice information of its acceleration devices to the accelerationmanagement node, so that the acceleration management node can configurean appropriate acceleration device for a client according to thereported acceleration device information, thereby meeting a servicerequirement and implementing accurate invocation.

In a first possible implementation manner of the second aspect, theacceleration device information further includes acceleration bandwidth.

With reference to the second aspect or the first possible implementationmanner of the second aspect, in a second possible implementation manner,the agent unit is further configured to: receive a configurationinstruction message from the acceleration management node. Theconfiguration instruction message indicates a target acceleration typeand a target algorithm type of a target acceleration device matching aninvocation request of a client. Alternatively, the configurationinstruction message indicates a target acceleration type, a targetalgorithm type, and target acceleration bandwidth of a targetacceleration device matching an invocation request of a client. Theagent unit invokes, according to the configuration instruction message,the driver to detect whether the target acceleration device worksnormally. When the target acceleration device works normally, the agentunit configures a target interface of the target acceleration device forthe client.

With reference to any one of the second aspect or the first to secondpossible implementation manners of the second aspect, in a thirdpossible implementation manner, the acceleration device informationfurther includes non-uniform memory access architecture (NUMA)information.

With reference to the third possible implementation manner of the secondaspect, in a fourth possible implementation manner, the configurationinstruction message further indicates target NUMA information matchingthe invocation request of the client.

With reference to any one of the second to fourth possibleimplementation manners of the second aspect, in a fifth possibleimplementation manner, the agent unit is further configured to configurethe target acceleration type, the target algorithm type, and the targetacceleration bandwidth as a hardware attribute of the target interface.

With reference to any one of the second to fifth possible implementationmanners of the second aspect, in a sixth possible implementation manner,the agent unit is further configured to respond to the accelerationmanagement node and release the target acceleration device.

With reference to the sixth possible implementation manner of the secondaspect, in a seventh possible implementation manner, the agent unit isfurther configured to set the hardware attribute of the target interfaceto null.

According to a third aspect, an embodiment of the present applicationprovides a client. The client includes a requesting unit, configured togenerate an invocation request according to an acceleration requirementof a service. The invocation request includes a target acceleration typeand a target algorithm type that are required for accelerating theservice. The client also includes a sending unit, configured to send theinvocation request to an acceleration management node to request toinvoke a target acceleration device matching the invocation request toaccelerate the service. An application program of the client may send,to the acceleration management node, a target acceleration type and atarget algorithm type. The target acceleration type and the targetalgorithm type correspond to an acceleration device that meets arequirement of accelerating a service of the application program. Theapplication program applies to the acceleration management node for theacceleration device, so that the acceleration management node can moreaccurately invoke a target acceleration device required by the client.

In a first possible implementation manner of the third aspect, theinvocation request further includes target acceleration bandwidthrequired for accelerating the service.

With reference to the third aspect or the first possible implementationmanner of the third aspect, in a second possible implementation manner,the invocation request further includes target NUMA information requiredby the service.

With reference to any one of the third aspect or the first to secondpossible implementation manners of the third aspect, in a third possibleimplementation manner, the requesting unit is further configured to:when the client needs to release the acceleration device, generate arelease request for releasing the target acceleration device. Thesending unit is further configured to send the release request to theacceleration management node.

According to a fourth aspect, an embodiment of the present applicationprovides an acceleration management method. The method includesseparately receiving, from at least on acceleration node, accelerationdevice information of all acceleration devices of the acceleration node.Each acceleration node includes at least one acceleration device, andthe acceleration device information includes an acceleration type and analgorithm type. The method further includes obtaining an invocationrequest from a client. The invocation request is used to invoke anacceleration device to accelerate a service of the client. Theinvocation request includes a target acceleration type and a targetalgorithm type. The method further includes querying the accelerationdevice information to determine, from all the acceleration devices ofthe at least one acceleration node, a target acceleration devicematching the invocation request; and instructing a target accelerationnode on which the target acceleration device is located to respond tothe invocation request. By obtaining acceleration device information ofeach acceleration node and invoking an acceleration device, anacceleration management node may allocate, according to a requirement ofan application program of a client and an acceleration type and analgorithm type of each acceleration device, a corresponding accelerationdevice to the application program. The method ensures normal running ofthe accelerated service and implements accurate invocation.

In a first possible implementation manner of the fourth aspect, the stepof querying the acceleration device information to determine a targetacceleration device includes: querying the acceleration deviceinformation to determine the target acceleration device whoseacceleration type and algorithm type are respectively the same as thetarget acceleration type and the target algorithm type.

With reference to the fourth aspect or the first possible implementationmanner of the fourth aspect, in a second possible implementation manner,the acceleration information further includes acceleration bandwidth.The acceleration bandwidth includes total bandwidth and occupiedbandwidth. The invocation request further includes target accelerationbandwidth. The step of querying the acceleration device information todetermine a target acceleration device includes: querying theacceleration device information to determine at least one candidateacceleration device. The acceleration type and algorithm type of thecandidate acceleration device are respectively the same as the targetacceleration type and the target algorithm type, and remaining bandwidthof the candidate acceleration device is greater than or equal to thetarget acceleration bandwidth. One of the at least one candidateacceleration devices is determined as the target acceleration device.The remaining bandwidth is obtained by calculation according to thetotal bandwidth and the occupied bandwidth.

With reference to the second possible implementation manner of thefourth aspect, in a third possible implementation manner, theacceleration device information further includes non-uniform memoryaccess architecture (NUMA) information. The invocation request furtherincludes target NUMA information. The step of querying the accelerationdevice information to determine, a target acceleration devicespecifically includes: querying the acceleration device information todetermine at least one candidate acceleration device. The accelerationtype and algorithm type of the at least one candidate accelerationdevice are respectively the same as the target acceleration type and thetarget algorithm type. Remaining bandwidth of the at least one candidateacceleration device is greater than or equal to the target accelerationbandwidth, and whose NUMA information is consistent with the target NUMAinformation. One of the at least one candidate acceleration device isdetermined as the target acceleration device, where the remainingbandwidth is obtained by calculation according to the total bandwidthand the occupied bandwidth.

With reference to either of the second possible implementation mannerand the third possible implementation manner of the fourth aspect, in afourth possible implementation manner, when there is one candidateacceleration device, the candidate acceleration device is determined asthe target acceleration device. Alternatively, when there is a pluralityof candidate acceleration devices, a first acceleration device havingmaximum remaining bandwidth is determined from the plurality ofcandidate acceleration devices according to the acceleration bandwidth,and if there is one first acceleration device, the first accelerationdevice is determined as the target acceleration device.

With reference to the fourth possible implementation manner of thefourth aspect, in a fifth possible implementation manner, theacceleration device information further includes a virtual function (VF)quantity. When there is a plurality of first acceleration devices havingthe maximum remaining bandwidth, a second acceleration device having amaximum VF quantity is determined from the plurality of firstacceleration devices, and if there is one second acceleration device,the second acceleration device is used as the target accelerationdevice.

With reference to the fifth possible implementation manner of the fourthaspect, in a sixth possible implementation manner, when there is aplurality of second acceleration devices having the maximum VF quantity,a second acceleration device first found is used as the targetacceleration device according to a time sequence of querying theacceleration device information.

With reference to any one of the fourth aspect or the first to sixthpossible implementation manners of the fourth aspect, in a seventhpossible implementation manner, the method further includes: storing theacceleration device information.

With reference to any one of the second to seventh possibleimplementation manners of the fourth aspect, in an eighth possibleimplementation manner, the method further includes: updating previouslystored acceleration device information corresponding to the targetacceleration device according to the target acceleration bandwidth; andrecording an allocation result.

With reference to any one of the fourth aspect or the first to eighthpossible implementation manners of the fourth aspect, in a ninthpossible implementation manner, the method further includes: obtaining arelease request from the client for releasing the target accelerationdevice, and invoking the target acceleration node to release the targetacceleration device.

With reference to the ninth possible implementation manner of the fourthaspect, in a tenth possible implementation manner, the method furtherincludes: when detecting that the service of the client becomesabnormal, finding the target acceleration device according to therecorded allocation result, and invoking the target acceleration node torelease the target acceleration device.

With reference to any one of the eighth to tenth possible implementationmanners of the fourth aspect, in an eleventh possible implementationmanner, the method further includes: setting the allocation result toinvalid.

According to a fifth aspect, an embodiment of the present applicationprovides an acceleration device configuration method that is applied toan acceleration node. The acceleration node includes a driver and atleast one acceleration device. The method includes: invoking the driverto separately query the at least one acceleration device to obtainacceleration device information of each acceleration device, where theacceleration device information includes an acceleration type and analgorithm type; and reporting the acceleration device information to anacceleration management node. The acceleration node reports accelerationdevice information of its acceleration devices to the accelerationmanagement node, so that the acceleration management node can configurean appropriate acceleration device for a client according to thereported acceleration device information, thereby meeting a servicerequirement and implementing accurate invocation.

In a first possible implementation manner of the fifth aspect, theacceleration device information further includes acceleration bandwidth.

With reference to the fifth aspect or the first possible implementationmanner of the fifth aspect, in a second possible implementation manner,the method further includes: receiving a configuration instructionmessage from the acceleration management node. The configurationinstruction message indicates a target acceleration type and a targetalgorithm type of a target acceleration device matching an invocationrequest of a client. Alternatively, the configuration instructionmessage indicates a target acceleration type, a target algorithm type,and target acceleration bandwidth of a target acceleration devicematching an invocation request of a client. The method further includesinvoking, according to the configuration instruction message, the driverto detect whether the target acceleration device works normally; andwhen the target acceleration device works normally, configuring a targetinterface of the target acceleration device for the client.

With reference to the fifth aspect or the second possible implementationmanner of the fifth aspect, in a third possible implementation manner,the acceleration device information further includes non-uniform memoryaccess architecture (NUMA) information.

With reference to the third possible implementation manner of the fifthaspect, in a fourth possible implementation manner, the configurationinstruction message further indicates target NUMA information matchingthe invocation request of the client.

With reference to either of the second possible implementation mannerand the fourth possible implementation manner of the fifth aspect, in afifth possible implementation manner, the method further includes:configuring the target acceleration type, the target algorithm type, andthe target acceleration bandwidth as a hardware attribute of the targetinterface.

With reference to any one of the second to fifth possible implementationmanners of the fifth aspect, in a sixth possible implementation manner,the method further includes: responding to the acceleration managementnode and releasing the target acceleration device.

With reference to the sixth possible implementation manner of the fifthaspect, in a seventh possible implementation manner, the method furtherincludes: setting the hardware attribute of the target interface tonull.

According to a sixth aspect, an embodiment of the present applicationprovides a method of applying for an acceleration device. The methodincludes: generating an invocation request according to an accelerationrequirement of a service. The invocation request includes a targetacceleration type and a target algorithm type that are required foraccelerating the service. The method further includes sending theinvocation request to an acceleration management node to request toinvoke a target acceleration device matching the invocation request toaccelerate the service. An application program of a client may send, tothe acceleration management node, a target acceleration type and atarget algorithm type that correspond to an acceleration device thatmeets a requirement of accelerating a service of the applicationprogram. The application program applies to the acceleration managementnode for the acceleration device, so that the acceleration managementnode can more accurately invoke a target acceleration device required bythe client, and ensure normal running of the service.

In a first possible implementation manner of the sixth aspect, theinvocation request further includes target acceleration bandwidthrequired for accelerating the service.

With reference to the sixth aspect or the first possible implementationmanner of the sixth aspect, in a second possible implementation manner,the invocation request further includes target NUMA information requiredby the service.

With reference to any one of the sixth aspect or the first to secondpossible implementation manners of the sixth aspect, in a third possibleimplementation manner, the method further includes: when theacceleration of the service is completed, generating a release requestfor releasing the target acceleration device; and sending the releaserequest to the acceleration management node.

According to a seventh aspect, an embodiment of the present applicationprovides an acceleration management system. The acceleration managementsystem includes the acceleration management node according to any one ofthe first aspect or the first to thirteenth possible implementationmanners of the first aspect and the acceleration node according to anyone of the second aspect or the first to seventh possible implementationmanners. The acceleration management system can accurately invoke,according to a service requirement of an application program of aclient, an appropriate acceleration device to accelerate a service ofthe application program and ensure normal running of the service.

BRIEF DESCRIPTION OF DRAWINGS

The following briefly introduces the accompanying drawings used indescribing the embodiments.

FIG. 1 is a schematic diagram of an application scenario ofvirtualization technology;

FIG. 2 is a schematic block diagram of an acceleration management nodeaccording to an embodiment of the present application;

FIG. 3 is a schematic block diagram of an acceleration node according toan embodiment of the present application;

FIG. 4 is a schematic block diagram of a client according to anembodiment of the present application;

FIG. 5 is a flowchart of an acceleration management method according toan embodiment of the present application;

FIG. 6 is a flowchart of an acceleration device configuration methodaccording to an embodiment of the present application; and

FIG. 7 is a flowchart of a method of applying for an acceleration deviceaccording to an embodiment of the present application.

DETAILED DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions in the embodiments ofthe present application with reference to the accompanying drawings.

First, the technical solutions of the present application may be appliedto various virtualization scenarios. Virtualization refers tovirtualizing one computer into a plurality of logical computers. Forexample, as shown in FIG. 1, a computation management module (not shown)in a client 300 (also referred to as a computer or a physical host) maycreate one or more virtual machines according to a user requirement. Forexample, FIG. 1 shows three virtual machines in the client 300, namely,virtual machine 300 a, virtual machine 300 b, and virtual machine 300 c.The virtual machines may run on different operating systems. Eachvirtual machine may be considered as a logical computer. Because allapplication programs of the virtual machines can run in mutuallyindependent spaces without affecting each other, the working efficiencyof the client 300 is significantly improved. In FIG. 1, an accelerationnode 200 may include general-purpose computer hardware, that is, anacceleration device such as a central processing unit (CPU) or agraphics processing unit (GPU), and each virtual machine in the client300 may invoke the acceleration device in the acceleration node 200 byusing an acceleration management node 100. Network functionvirtualization (NFV) uses general-purpose hardware such as x86 and avirtualization technology to implement software processing of a lot offunctions, so as to reduce network device costs. NFV may be consideredas an application of the virtualization technology. In addition, thevirtualization technology may also be applied in scenarios such aspublic cloud, private cloud, enterprise cloud, and cloud acceleration.Therefore, the solutions of the embodiments of the present applicationare not limited to an NFV scenario, and the protection scope of thepresent application should not be limited thereto.

To better describe the technical solutions of the present application,the technical solutions of the present application are described indetail below with reference to FIG. 2 to FIG. 4.

FIG. 2 is a schematic block diagram of an acceleration management node100 according to an embodiment of the present application. Theacceleration management node 100 includes a receiving unit 101, anobtaining unit 103, an allocation unit 104, and an instruction unit 105.

The receiving unit 101 is configured to separately receive, from atleast one acceleration nodes, acceleration device information of allacceleration devices of the acceleration node. Each acceleration nodeincludes at least one acceleration device. The acceleration deviceinformation of the acceleration device includes an acceleration type andan algorithm type of the acceleration device. The acceleration typeindicates a type of an acceleration function supported by theacceleration device. Common acceleration functions may includeencryption, decryption, compression, decompression, audio and videoencoding and decoding, and the like. The algorithm type indicates analgorithm used by the acceleration device in executing an accelerationfunction supported by the acceleration device.

To better describe the technical solutions of the present application,as an example shown in FIG. 2, in some virtualization scenarios, threeacceleration nodes, namely, acceleration node 200 a, acceleration node200 b, and acceleration node 200 c, are used. An actual quantity ofacceleration nodes may be set according to a network requirement. Nolimitation is imposed herein. Each acceleration node may include atleast one hardware acceleration device such as a CPU, a GPU, or aperipheral component interconnect (PCI) device. Each acceleration devicehas its own acceleration type, algorithm type, and the like. That is,each acceleration device corresponds to one piece of acceleration deviceinformation. Different acceleration devices may correspond to same ordifferent acceleration device information. When an acceleration nodeincludes two acceleration devices, namely, a CPU and a GPU, theacceleration node may separately report acceleration device informationof the CPU and acceleration device information of the GPU to theacceleration management node 100 through the receiving unit 101. Inaddition, the receiving unit 101 may be a reporting interface and mayspecifically include a software interface. For example, the accelerationnode 200 a may invoke the reporting interface in a Remote Procedure CallProtocol (RPC) manner, to report the acceleration device information ofall the acceleration devices in the acceleration node 200 a to theacceleration management node 100. The other acceleration nodes 200 b and200 c are similar to the acceleration node 200 a, and details are notdescribed herein again.

The acceleration management node 100 in this embodiment of the presentapplication may be a management program running on a physical host. Thephysical host may include a processor, a memory, and an input/output(I/O) interface. The management program is stored in the memory. Theprocessor can read and run the management program stored in the memory.Further, the receiving unit 101 may be a software I/O interface, and theacceleration node may use various communications tools (for example, acommunications tool Rabbit MQ) between software I/O interfaces toremotely invoke the software I/O interface for communication. Thecommunication may also be performed between software I/O interfaces byusing various other message queues. No specific limitation is imposedherein.

The obtaining unit 103 is configured to obtain an invocation requestfrom a client 300. The invocation request is used to invoke anacceleration device to accelerate a service of the client 300, and theinvocation request includes a target acceleration type and a targetalgorithm type.

The client 300 may be specifically a physical host that runs anapplication program. When a service (or function) of the applicationprogram needs to be accelerated, the application program of the client300 notifies, through the obtaining unit 103, the accelerationmanagement node 100 of information, such as a target acceleration typeand a target algorithm type, of an acceleration device requested foraccelerating the service. By doing so, the application program appliesto the acceleration management node 100 for a hardware resource (thatis, an acceleration device) for acceleration. The obtaining unit 103 mayalso be an application programming interface (API). The applicationprogram of the client 300 may communicate with the obtaining unit 103 byinvoking the application programming interface. Each type of service ofthe application program requires a target acceleration type and a targetalgorithm type that comply with its service specification.

The allocation unit 104 is configured to query the acceleration deviceinformation to determine, from all the acceleration devices of the atleast one acceleration node, a target acceleration device matching theinvocation request.

After obtaining the invocation request from the client 300, theallocation unit 104 searches acceleration device information of allacceleration nodes that is stored in a storage unit 102, for a targetacceleration device that meets the target acceleration type and thetarget algorithm type required by the invocation request.

The instruction unit 105 is configured to instruct a target accelerationnode, on which the target acceleration device is located, to respond tothe invocation request and configure the target acceleration device forthe client 300.

Optionally, the acceleration management node 100 further includes thestorage unit 102, configured to store the acceleration deviceinformation.

The storage unit 102 may store the obtained acceleration deviceinformation in a local memory of the acceleration management node 100 orin a network memory connected to the acceleration management node 100through a network. No limitation is imposed herein. In addition, thestorage unit 102 may store the acceleration device information in a listform, a database form, or another storage form known to persons skilledin the art.

For example, after the client 300 requests the acceleration managementnode 100 to invoke an acceleration device, the acceleration managementnode 100 determines, by querying the acceleration device informationobtained from the acceleration nodes 200 a, 200 b, and 200 c, that atarget acceleration device required for meeting the invocation requestof the client 300 is located on the acceleration node 200 c. In thiscase, the instruction unit 105 may invoke a configuration interface ofthe acceleration node 200 c in an RPC manner to allocate the targetacceleration type and the target algorithm type to the acceleration node200 c. The acceleration node 200 c configures the corresponding targetacceleration device for the client 300, thereby providing a hardwareacceleration function for the service of the application program of theclient 300.

In this embodiment, the acceleration management node invokes anacceleration device according to acceleration device information in eachacceleration node and may allocate, according to a requirement of anapplication program of a client and an acceleration type and analgorithm type of each acceleration device, a corresponding accelerationdevice to the application program. As known by persons skilled in theart, acceleration refers to allocating some services of an applicationprogram to a hardware acceleration device for operation. Becauseefficiency of logical operations of the hardware acceleration device ishigher than that of a software algorithm, an operation time can besaved, thereby achieving acceleration. However, in the prior art, whenan acceleration device is invoked, a specific acceleration type andalgorithm type supported by the acceleration device are not considered.Using acceleration of encryption and decryption as an example, only anencryption and decryption type, such as IPSec, can be perceived in theprior art, and invocation is performed according to the encryption anddecryption type IPSec. However, the encryption and decryption type IPSecfurther includes three sub-types, namely, triple data encryptionalgorithm (3DES), Diffie-Hellman (D-H or DH) algorithm, and advancedencryption standard (AES). In the prior art, an acceleration device ofthe IPSec-DH type may be invoked for a service that requires anacceleration device of the IPSec-3DES type, resulting in that aninvocation result cannot meet the requirement of the service. Comparedwith the prior art, the technical solutions of the present applicationcan ensure accuracy of an invocation result, so that an attribute of anacceleration device invoked by the client 300 can meet a requirement ofan application program.

In this embodiment, the allocation unit 104 may be specificallyconfigured to query the acceleration device information to determine,from all the acceleration devices of the at least one acceleration node,the target acceleration device whose acceleration type and algorithmtype are respectively the same as the target acceleration type and thetarget algorithm type.

In this embodiment, further, the acceleration information obtained bythe receiving unit 101 may further include acceleration bandwidth. Theacceleration bandwidth may include total bandwidth of an accelerationdevice and details of occupied bandwidth of the acceleration device at acurrent moment. The total bandwidth of the acceleration device refers tomaximum acceleration bandwidth that can be provided by the accelerationdevice in a zero-load state. Correspondingly, the invocation requestobtained by the obtaining unit 103 may further include targetacceleration bandwidth. The target acceleration bandwidth indicatesbandwidth required by a service for which acceleration is requested bythe client 300.

In this embodiment, the acceleration bandwidth of each accelerationdevice includes the total bandwidth and the occupied bandwidth. Theallocation unit 104 may first query the acceleration device informationto obtain at least one candidate acceleration device whose accelerationtype and algorithm type are respectively the same as the targetacceleration type and the target algorithm type, and whose remainingbandwidth is greater than or equal to the target acceleration bandwidth.In other words, allocation unit 104 obtains at least one candidateacceleration device matching the invocation request, and determines oneof the at least one candidate acceleration device as the targetacceleration device. The remaining bandwidth is obtained by calculationaccording to the total bandwidth and the occupied bandwidth.

As can be seen, the acceleration management node 100 may allocate acorresponding acceleration device to the application program accordingto acceleration bandwidth of each acceleration device, so as to ensurethat the allocated acceleration device can provide sufficientacceleration bandwidth for the application program, thereby implementingaccurate invocation. However, in the prior art, the accelerationbandwidth of an acceleration device is not considered, and whenremaining bandwidth of the acceleration device does not meet a servicerequirement, a prolonged acceleration time or an acceleration failuremay also be caused, failing to achieve acceleration.

Further, when the acceleration node 200 uses a multi-processorarchitecture, the acceleration node 200 may provide a separate memoryfor each processor by using a non-uniform memory access architecture(NUMA), thereby avoiding performance loss caused by access of multipleprocessors to a same memory. Therefore, processors in the accelerationnode 200 may be grouped according to NUMA information, and theprocessors in different groups have different NUMA information. Inaddition, the acceleration devices in the acceleration node 200 usuallybelong to different processors. Therefore, each acceleration device hassame NUMA information as that of the processor to which the accelerationdevice belongs. Correspondingly, the acceleration device informationobtained by the receiving unit 101 may further include NUMA information.Moreover, the client 300 and the acceleration node may be located on asame physical host, and a virtual machine on which the applicationprogram for which acceleration is requested by the client 300 is locatedalso has same NUMA information as that of a processor to which thevirtual machine belongs. Therefore, when invoking an accelerationdevice, the client 300 may also specify target NUMA information in theinvocation request according to the requirement of the service of theapplication program.

In other words, the client 300 may also specify the target NUMAinformation in the invocation request on the basis of ensuring thatcross-NUMA access to a memory corresponding to another processor doesnot need to be performed during service acceleration. The allocationunit 105 may query the acceleration device information to determine atleast one candidate acceleration device. The acceleration type andalgorithm type of the at least one candidate acceleration device arerespectively the same as the target acceleration type and the targetalgorithm type. Remaining bandwidth of the at least one candidateacceleration device is greater than or equal to the target accelerationbandwidth, and NUMA information of the at least one candidateacceleration device is consistent with the target NUMA information. Theallocation unit 105 determines one of the at least one candidateacceleration device as the target acceleration device. The remainingbandwidth is obtained by calculation according to the total bandwidthand the occupied bandwidth. In such a manner, an acceleration devicewhose NUMA information is consistent with the target NUMA informationcan be scheduled to the client, so as to ensure that a process of theservice and the acceleration device are on a same NUMA, therebyimproving read/write performance during storage. This manner is alsoreferred to as processor affinity scheduling. Refer to the prior art fordetails, and the details are not described herein.

Because there may be one or more candidate acceleration devices, whenthe allocation unit 104 determines a target acceleration device from theat least one candidate acceleration device, the following cases may beincluded.

(1) When there is one candidate acceleration device, the candidateacceleration device is determined as the target acceleration device.

(2) When there is a plurality of candidate acceleration devices, theallocation unit determines a first acceleration device having maximumremaining bandwidth from the plurality of candidate acceleration devicesaccording to the acceleration bandwidth. If there is one firstacceleration device, the first acceleration device is determined as thetarget acceleration device. The remaining bandwidth of the candidateacceleration device is obtained by calculation according to the totalbandwidth and the occupied bandwidth. In addition, in this embodiment,if a third acceleration device whose remaining bandwidth isapproximately equal to the target acceleration bandwidth exists in theplurality of candidate acceleration devices, the third accelerationdevice may also be determined as the target acceleration device. Beingapproximately equal refers to that a slight difference in value isallowed.

(3) When there is a plurality of candidate acceleration devices, andthere is a plurality of first acceleration devices having the maximumremaining bandwidth in the plurality of the candidate accelerationdevices, the acceleration device information reported by theacceleration node 200 to the acceleration management node 100 furtherincludes a virtual function (VF) quantity. The allocation unitdetermines a second acceleration device having a maximum VF quantityfrom the plurality of first acceleration devices according to the VFquantity, and if there is one second acceleration device, uses thesecond acceleration device as the target acceleration device.

(4) When there is a plurality of candidate acceleration devices, andthere is a plurality of first acceleration devices having the maximumremaining bandwidth in the plurality of the candidate accelerationdevices, if there is a plurality of second acceleration devices havingthe maximum VF quantity, the allocation unit uses a second accelerationdevice first found as the target acceleration device according to a timesequence of querying the acceleration device information.

In the foregoing manner, the acceleration management node 100 candetermine an optimal target acceleration device for the client 300, andinvoke the optimal target acceleration device for the client 300,thereby implementing accurate invocation.

In this embodiment, for example, specifically, the instruction unit 105may send a configuration instruction message to the target accelerationnode, to instruct the target acceleration node to respond to theinvocation request. The configuration instruction message is used toinstruct the target acceleration node to configure the targetacceleration device for the client 300. The configuration instructionmessage may specifically indicate an acceleration type and an algorithmtype of the target acceleration device matching the invocation request,or the configuration instruction message indicates an acceleration type,an algorithm type, and acceleration bandwidth of the target accelerationdevice.

Further, in this embodiment, the storage unit 102 may further beconfigured to update previously stored acceleration device informationcorresponding to the target acceleration device according to the targetacceleration bandwidth. The storage unit 102 stores accelerationbandwidth of the target acceleration device before the targetacceleration device is configured for the client 300. The accelerationbandwidth includes total bandwidth and details of unoccupied bandwidthof the target acceleration device before the target acceleration deviceis configured. After the target acceleration device is configured forthe client 300 to provide hardware acceleration for the service of theclient 300, correspondingly, the occupied bandwidth of the targetacceleration device changes. The target acceleration bandwidth needs tobe subtracted from the occupied bandwidth before the configuration toobtain new occupied bandwidth, and the acceleration bandwidth stored inthe storage unit 102 needs to be updated by using the new occupiedbandwidth. The acceleration bandwidth of the target acceleration deviceis updated for the purpose of allowing the acceleration management node100 to subsequently allocate, in real time according to currentacceleration bandwidth of the target acceleration device, anacceleration device for a new invocation request from the client 300. Inaddition, the storage unit 102 may further be configured to record anallocation result of the instruction unit. The allocation resultspecifically indicates which acceleration device is configured for theclient 300, and indicates acceleration device information and the likeafter the configuration, so that when subsequently finding duringperiodical monitoring that a service of the client 300 becomes abnormal,the acceleration management node can find an acceleration devicecorresponding to the abnormal service and release the accelerationdevice.

Further, in this embodiment, the acceleration management node 100further includes a releasing unit 106, configured to obtain a releaserequest from the client 300 for releasing the target accelerationdevice, and invoke the target acceleration node to release the targetacceleration device. Still using the acceleration node 200 c as anexample, because the target acceleration device located on theacceleration node 200 c is configured for the client 300, when theapplication program in the client 300 needs to release the accelerationdevice, the client 300 may instruct, by using a release request, theacceleration management node 100 to release the target accelerationdevice.

Still further, after the target acceleration device is released, thestorage unit 102 is further configured to set the previously storedallocation result to invalid. Because the target acceleration device isalready released, the allocation result of the target accelerationdevice also needs to be set to invalid, so as not to affect subsequentallocation of an acceleration device by the acceleration management nodefor the client.

As shown in FIG. 3, an embodiment of the present application provides aschematic structural diagram of an acceleration node 200. Theacceleration node 200 includes an agent unit 201, a driver 202, and atleast one acceleration device. For example, 203 a and 203 b are used torespectively represent two acceleration devices, and an actual quantityof acceleration devices is not limited thereto. The driver 202 isconfigured to drive the acceleration devices 203 a and 203 b, and theacceleration devices 203 a and 203 b are each configured to provide ahardware acceleration function. The agent unit 201 is configured to:

invoke the driver 202 to separately query the at least one accelerationdevice to obtain acceleration device information of each accelerationdevice, where the acceleration device information includes anacceleration type and an algorithm type, and for example, the agent unit201 may periodically invoke the driver 202 to query each interface onthe acceleration devices 203 a and 203 b to obtain acceleration deviceinformation of the acceleration devices 203 a and 203 b; and report theobtained acceleration device information to the acceleration managementnode 100. Specifically, after obtaining the acceleration deviceinformation by query, the agent unit 201 may invoke the receiving unit101 in the acceleration management node 100 in an RPC manner to reportthe acceleration device information to the acceleration management node100.

In this embodiment, the acceleration node 200 may be specifically aphysical host. The physical host may include a memory, a processor, andat least one acceleration device (also referred to as an accelerator).The acceleration device may be a processor, a GPU, an FPGA, a PCIdevice, or the like. The agent unit 201 and the driver 202 may beprogram instructions stored in the memory. The processor reads theprogram instructions in the memory to perform corresponding functions ofthe agent unit 201 and the driver 202.

In this embodiment, the acceleration device information further includesacceleration bandwidth.

In this embodiment, the acceleration node reports acceleration deviceinformation of its acceleration devices to an acceleration managementnode, so that the acceleration management node can configure anappropriate acceleration device for a client according to the reportedacceleration device information, thereby meeting a service requirementand implementing accurate invocation.

Further, in this embodiment, the agent unit 201 is further configuredto:

receive a configuration instruction message from the accelerationmanagement node 100, where if the acceleration device informationincludes the acceleration type and the algorithm type, the configurationinstruction message indicates a target acceleration type and a targetalgorithm type of a target acceleration device matching an invocationrequest of a client, or if the acceleration device information includesthe acceleration type, the algorithm type, and the accelerationbandwidth, the configuration instruction message indicates a targetacceleration type, a target algorithm type, and target accelerationbandwidth of a target acceleration device matching an invocation requestof a client 300; invoke, according to the configuration instructionmessage, the driver 202 to detect whether the target acceleration deviceworks normally; and when the target acceleration device works normally,configure a target interface of the target acceleration device for theclient 300.

Further, in this embodiment, when the acceleration node 200 and theclient 300 are a same physical host, and the physical host uses amulti-core architecture, the acceleration device information furtherincludes non-uniform memory access architecture (NUMA) information.Correspondingly, the configuration instruction message further indicatestarget NUMA information matching the invocation request of the client.

The acceleration node reports NUMA information of each accelerationdevice to the acceleration management node 100, so that the accelerationmanagement node 100 allocates an appropriate target acceleration deviceto the client 300 according to the NUMA information, so as to ensurethat the service of the client and the target acceleration device are ona same NUMA, thereby improving read/write performance during storage.

When providing an acceleration function for the client 300, theacceleration device specifically communicates with the client 300 byusing an interface of the acceleration device. An acceleration devicemay include one or more interfaces. During configuration, the agent unit201 configures one of the interfaces as the target interface for theclient.

Still further, the agent unit 201 is further configured to configure thetarget acceleration type, the target algorithm type, and the targetacceleration bandwidth as a hardware attribute of the target interface.In the foregoing descriptions, after the target interface of the targetacceleration device is configured for the client 300, the targetacceleration device can provide an acceleration function for the client300. In addition, if the acceleration bandwidth of the targetacceleration device is not completely occupied, theoretically, thetarget acceleration device may also provide a hardware accelerationfunction for an application program of another client by using anotherinterface. However, because the agent unit 201 configures the targetacceleration device according to the configuration instruction messagefrom the acceleration management node 100, and when determining thetarget acceleration device, the acceleration management node uses anacceleration device whose acceleration type and algorithm type arerespectively the same as the target acceleration type and the targetalgorithm type and whose remaining bandwidth is greater than or equal tothe target acceleration bandwidth as the target acceleration device, ifa target acceleration device whose unoccupied bandwidth that is fargreater than the target acceleration bandwidth required by the client,an acceleration capability of the target acceleration device is wasted.Therefore, in this embodiment, after configuring the target interfacefor the client 300, the agent unit 201 may further configure the targetacceleration type, the target algorithm type, and the targetacceleration bandwidth as the hardware attribute of the targetinterface. In this way, subsequently the agent unit 201 can periodicallyinvoke the driver 202 to query various interfaces including the targetinterface of the target acceleration device and obtain an accelerationdevice attribute of the target acceleration device in real time, so thatthe acceleration management node 100 can allocate the targetacceleration device to another client, thereby maximizing utilization ofan acceleration capability of the target acceleration device.

In this embodiment, further, after the acceleration of the service ofthe client 300 is completed, the client 300 sends a release request forreleasing the target acceleration device to the acceleration managementnode 100, so that the acceleration management node 100 invokes the agentunit 201 to release the target acceleration device. Therefore, the agentunit 201 is further configured to respond to the acceleration managementnode 100 and release the target acceleration device.

Still further, the agent unit 210 is further configured to set thehardware attribute of the target interface to null.

In the foregoing descriptions, to maximize the utilization of theacceleration capability of the target acceleration device, the agentunit 210 configures the target acceleration type, the target algorithmtype, and the target acceleration bandwidth as the hardware attribute ofthe target interface. After responding to the acceleration managementnode 100 and releasing the target acceleration device, correspondingly,the agent unit 201 also needs to set the hardware attribute of thetarget interface to null to indicate that the target interface isunoccupied, so as to prevent the agent unit 201 from obtaining incorrectacceleration device information of the target acceleration device whenthe proxy unit 201 periodically queries the acceleration deviceinformation.

As shown in FIG. 4, an embodiment of the present application provides aschematic structural diagram of a client 300. The client 300 includes:

a requesting unit 301, configured to generate an invocation requestaccording to an acceleration requirement of a service, where theinvocation request includes a target acceleration type and a targetalgorithm type that are required for accelerating the service; and

a sending unit 302, configured to send the invocation request to anacceleration management node to request to invoke a target accelerationdevice matching the invocation request to accelerate the service.

Further, the invocation request may further include target accelerationbandwidth required for accelerating the service.

Still further, the invocation request may further include target NUMAinformation required for accelerating the service.

In this embodiment, the client 300 may be specifically a physical hostrunning an application program. The physical host may include a memoryand a processor. The processor reads an application program in thememory to perform a corresponding function. The application program maybe divided into a requesting unit 301 and a sending unit 302 accordingto functions. The requesting unit 301 generates a correspondinginvocation request according to an acceleration requirement of a service(that is, some functions of the application program) that needs to beoffloaded to hardware for acceleration. The invocation requestspecifically includes a target acceleration type, a target algorithmtype, and target acceleration bandwidth that are required foraccelerating the service, or may further include target NUMAinformation. The sending unit 302 feeds back the invocation request tothe acceleration management node 100 by using a communications interfacebetween the sending unit 302 and the acceleration management node 100,so as to apply to the acceleration management node 100 for a targetacceleration device matching the invocation request.

By means of the solution of this embodiment of the present application,an application program of a client may send, to an accelerationmanagement node, a target acceleration type, a target algorithm type,and target acceleration bandwidth that correspond to an accelerationdevice that meets a requirement of accelerating a service of theapplication program, to apply to the acceleration management node forthe acceleration device, so that the acceleration management node canmore accurately invoke a target acceleration device required by theclient. In addition, because an acceleration type, an algorithm type,acceleration bandwidth, and target NUMA information of the targetacceleration device invoked by the acceleration management node areconsistent with the target acceleration type, the target algorithm type,the target acceleration bandwidth, and the target NUMA information forwhich the client applies, normal running of the service can be ensured.

Further, the requesting unit 301 is further configured to: when theacceleration of the service is completed, generate a release request forreleasing the target acceleration device.

The sending unit 302 is further configured to send the release requestto the acceleration management node 100, so that the accelerationmanagement node invokes a target acceleration node on which the targetacceleration device is located to release the target accelerationdevice.

That is, after the acceleration of the service of the applicationprogram of the client is completed, the acceleration management nodeneeds to be instructed to release a corresponding target accelerationdevice, so as to avoid unnecessary occupation of the target accelerationdevice.

Methods of the embodiments of the present application are brieflydescribed below with reference to FIG. 5 to FIG. 7. The methodembodiments shown in FIG. 5 to FIG. 7 are in a one-to-one correspondencewith the apparatus embodiments shown in FIG. 2 to FIG. 4. Therefore,reference can be made to each other, and descriptions are not providedagain below.

As shown in FIG. 5, an embodiment of the present application provides aflowchart of an acceleration management method. The method is applied toan acceleration management node (refer to FIG. 2). The method mayinclude the following steps.

S401: Separately receive acceleration device information of allacceleration devices of each of at least one acceleration node reportedby the acceleration node, where each acceleration node includes at leastone acceleration device, and the acceleration device informationincludes an acceleration type and an algorithm type.

S402: Store the acceleration device information. S402 is optionalbecause a receiving unit that receives the acceleration deviceinformation may have a cache capability.

S403: Obtain an invocation request from a client, where the invocationrequest is used to invoke an acceleration device to accelerate a serviceof the client, and the invocation request includes a target accelerationtype and a target algorithm type.

S404: Query the acceleration device information to determine, from allthe acceleration devices of the at least one acceleration node, a targetacceleration device matching the invocation request.

S405: Instruct a target acceleration node on which the targetacceleration device is located to respond to the invocation request, sothat the target acceleration node configures the target accelerationdevice for the client. For example, the acceleration management node maysend a configuration instruction message to the target acceleration nodewhere the configuration instruction message is used to instruct thetarget acceleration node to configure the target acceleration device forthe client.

More specifically, S404 may include: querying the acceleration deviceinformation to determine, from all the acceleration devices of the atleast one acceleration node, the target acceleration device whoseacceleration type and algorithm type are respectively the same as thetarget acceleration type and the target algorithm type.

In this embodiment, by obtaining acceleration device information of eachacceleration node and invoking an acceleration device, an accelerationmanagement node may allocate, according to a requirement of anapplication program of a client and an acceleration type and analgorithm type of each acceleration device, a corresponding accelerationdevice to the application program, thereby implementing correctinvocation and ensuring normal running of the accelerated service.

Further, the acceleration information further includes accelerationbandwidth. The acceleration bandwidth of each acceleration deviceincludes total bandwidth and occupied bandwidth. Correspondingly, theinvocation request further includes target acceleration bandwidth.

S404 may specifically include:

querying the acceleration device information to determine, from all theacceleration devices of the at least one acceleration node, at least onecandidate acceleration device whose acceleration type and algorithm typeare respectively the same as the target acceleration type and the targetalgorithm type and whose remaining bandwidth is greater than or equal tothe target acceleration bandwidth, and determining one of the at leastone candidate acceleration device as the target acceleration device,where the remaining bandwidth is obtained by calculation according tothe total bandwidth and the occupied bandwidth.

Still further, the acceleration device information received in S401 mayfurther include NUMA information. The invocation request obtained inS403 may further include target NUMA information. S404 may specificallyinclude:

querying the acceleration device information to determine, from all theacceleration devices of the at least one acceleration node, at least onecandidate acceleration device whose acceleration type and algorithm typeare respectively the same as the target acceleration type and the targetalgorithm type, whose remaining bandwidth is greater than or equal tothe target acceleration bandwidth, and whose NUMA information isconsistent with the target NUMA information, and determining one of theat least one candidate acceleration device as the target accelerationdevice, where the remaining bandwidth is obtained by calculationaccording to the total bandwidth and the occupied bandwidth.

Further, the determining one of the at least one candidate accelerationdevice as the target acceleration device in S404 may include:

when there is one candidate acceleration device, determining thecandidate acceleration device as the target acceleration device;

when there is a plurality of candidate acceleration devices, determininga first acceleration device having maximum remaining bandwidth from theplurality of candidate acceleration devices according to theacceleration bandwidth, and if there is one first acceleration device,determining the first acceleration device as the target accelerationdevice bandwidth, where the remaining bandwidth of the candidateacceleration device may be obtained by calculation according to thetotal bandwidth and the occupied bandwidth;

when there is a plurality of candidate acceleration devices, and thereis a plurality of first acceleration devices having the maximumremaining bandwidth in the plurality of the candidate accelerationdevices, determining a second acceleration device having a maximum VFquantity from the plurality of first acceleration devices, and if thereis one second acceleration device, using the second acceleration deviceas the target acceleration device, where in S401, the accelerationdevice information received by the acceleration management node includesa VF quantity that is supported by each acceleration device in theacceleration node and that is reported by the acceleration node; or

when there is a plurality of candidate acceleration devices, and thereis a plurality of first acceleration devices having the maximumremaining bandwidth in the plurality of the candidate accelerationdevices, if there is a plurality of second acceleration devices havingthe maximum VF quantity, using a second acceleration device first foundas the target acceleration device according to a time sequence ofquerying the acceleration device information.

In this embodiment, for example, S405 may include: sending aconfiguration instruction message to the target acceleration node, toinstruct the target acceleration node to respond to the invocationrequest. The configuration instruction message is used to instruct thetarget acceleration node to configure the target acceleration device forthe client. The configuration instruction message may specificallyindicate an acceleration type and an algorithm type of the targetacceleration device matching the invocation request, or theconfiguration instruction message indicates an acceleration type, analgorithm type, and acceleration bandwidth of the target accelerationdevice.

In this embodiment, further, the method may further include:

S406: Update previously stored acceleration device informationcorresponding to the target acceleration device according to the targetacceleration bandwidth; and record an allocation result, where theallocation result indicates which acceleration device is allocated asthe target acceleration device to the client by the accelerationmanagement node according to the invocation request. If the accelerationdevice information only includes the acceleration type and the algorithmtype, only the allocation result of the acceleration management node isrecorded in S406.

S406 may be performed after S405 or may be performed at the same time asS405. No limitation is imposed herein.

Further, the method further includes:

Step 407 a: Obtain a release request from the client for releasing thetarget acceleration device, and invoke the target acceleration node torelease the target acceleration device.

Alternatively, S407 b: When detecting that the service of the clientbecomes abnormal, find the target acceleration device according to therecorded allocation result, and invoke the target acceleration node torelease the target acceleration device. The acceleration management nodemay periodically monitor whether a service for which each client appliesfor acceleration runs normally. If a service becomes abnormal, theacceleration management node may find, according to the allocationresult recorded in S406, a target acceleration device configured for theabnormal service, and invoke a target acceleration node on which thetarget acceleration device is located to release the target accelerationdevice, so as to prevent the target acceleration device from unnecessaryoperation after the service becomes abnormal.

Still further, after S407 a or S407 b, the method further includes:

S408: Set the allocation result to invalid.

Because the target acceleration device is already released, theallocation result of the target acceleration device also needs to be setto invalid, so as not to affect subsequent allocation of an accelerationdevice by the acceleration management node for the client.

As shown in FIG. 6, an embodiment of the present application furtherprovides a flowchart of an acceleration device configuration method. Themethod is applied to an acceleration node (refer to FIG. 3). Theacceleration node includes a driver and at least one accelerationdevice. The method includes the following steps.

S501: Invoke the driver to separately query the at least oneacceleration device to obtain acceleration device information of eachacceleration device. The acceleration device information includes anacceleration type and an algorithm type.

S502: Report the acceleration device information to an accelerationmanagement node.

In this embodiment, an acceleration node reports acceleration deviceinformation of its acceleration devices to an acceleration managementnode, so that the acceleration management node can configure anappropriate acceleration device for a client according to the reportedacceleration device information, thereby meeting a service requirementand implementing accurate invocation.

Further, the acceleration device information may further includeacceleration bandwidth.

Further, in this embodiment, the method further includes the followingsteps.

S503: Receive a configuration instruction message from the accelerationmanagement node. If the acceleration device information includes theacceleration type and the algorithm type, the configuration instructionmessage indicates a target acceleration type and a target algorithm typeof a target acceleration device matching the invocation request of theclient. If the acceleration device information includes the accelerationtype, the algorithm type, and the acceleration bandwidth, theconfiguration instruction message indicates a target acceleration type,a target algorithm type, and target acceleration bandwidth of a targetacceleration device matching the invocation request of the client.

S504: Invoke, according to the configuration instruction message, thedriver to detect whether the target acceleration device works normally.

S505: When the target acceleration device works normally, configure atarget interface of the target acceleration device for the client.

After the target interface of the target acceleration device isconfigured for the client, the application program of client can invokethe target interface and run a service to be accelerated of theapplication program.

When the acceleration node uses a multi-processor architecture,acceleration devices may be grouped according to processors to which theacceleration devices respectively belong. Therefore, in step S501, theacceleration device information may further include NUMA information.The NUMA information may indicate a grouping status of each accelerationdevice.

Correspondingly, the configuration instruction message received in stepS503 may further indicate target NUMA information matching theinvocation request of the client.

S506: Configure the target acceleration type, the target algorithm type,and the target acceleration bandwidth as a hardware attribute of thetarget interface. By means of the configuration of the hardwareattribute of the target interface, the acceleration node cansubsequently query the remaining acceleration bandwidth of the targetacceleration device, so that the acceleration management node canallocate the target acceleration device to another client, therebymaximizing utilization of an acceleration capability of the targetacceleration device.

S507: Respond to the acceleration management node and release the targetacceleration device.

S508: Set the hardware attribute of the target interface to null.

As shown in FIG. 7, an embodiment of the present application furtherprovides a flowchart of a method of applying for an acceleration device.The method is applied to a client. The method includes the followingsteps.

S601: Generate an invocation request according to an accelerationrequirement of a service. The invocation request includes a targetacceleration type and a target algorithm type that are required foraccelerating the service.

S602: Send the invocation request to an acceleration management node torequest to invoke a target acceleration device matching the invocationrequest to accelerate the service. The acceleration management nodeinvokes a target acceleration device according to the targetacceleration type and the target algorithm type, so that an accelerationtype and an algorithm type of the target acceleration device match theacceleration requirement of the service of the client, therebyimplementing accurate invocation.

Further, in step S601, if acceleration device information reported by anacceleration node to the acceleration management node includesacceleration bandwidth, the invocation request generated by the clientfurther includes target acceleration bandwidth required for acceleratingthe service.

In this embodiment, an application program of a client may send, to anacceleration management node, a target acceleration type, a targetalgorithm type, and target acceleration bandwidth that correspond to anacceleration device that meets a requirement of accelerating a serviceof the application program. The application program applies to theacceleration management node for the acceleration device, so that theacceleration management node can more accurately invoke a targetacceleration device required by the client, and ensure normal running ofthe service.

In this embodiment, when the acceleration node uses a multi-processorarchitecture, acceleration devices in the acceleration node may begrouped according to NUMA information. Therefore, the invocation requestmay further include target NUMA information required by the service, sothat the service and the target acceleration device required by theservice are configured on a same NUMA. In this embodiment, the clientand the acceleration node may actually be a same physical host, and theapplication program and the agent unit in the acceleration node aredifferent processes or different software modules. Therefore,configuring the service and target acceleration device on a same NUMAcan ensure that the service and the target acceleration device read amemory in the same NUMA, thereby improving read performance.

S603: When the acceleration of the service is completed, generate arelease request for releasing the target acceleration device.

S604: Send the release request to the acceleration management node.

After the acceleration of the service of the application program of theclient is completed, the client may instruct, by performing steps S603and S604, the acceleration management node to release the correspondingtarget acceleration device, so as to avoid unnecessary occupation of thetarget acceleration device.

An embodiment of the present application further provides anacceleration management system. Referring to FIG. 1, the accelerationmanagement system includes an acceleration management node 100 and atleast one acceleration node 200. For the acceleration management node100, refer to the acceleration management node shown in FIG. 2 and thecorresponding embodiment. For the acceleration node 200, refer to theacceleration node shown in FIG. 3 and the corresponding embodiment.Details are not described herein again. The acceleration managementsystem provided by this embodiment of the present application canaccurately invoke, according to a service requirement of an applicationprogram of a client, an appropriate acceleration device to acceleratethe service of the application program, and ensure normal running of theservice.

It is understood that all or some of the steps of the method embodimentsmay be implemented by a program instructing relevant hardware. Theprogram may be stored in a computer-readable storage medium. When theprogram runs, the steps of the method embodiments are performed. Theforegoing storage medium includes: any medium that can store programcode, such as a read-only memory (ROM), a random access memory (RAM), amagnetic disk, or an optical disc.

Finally, the foregoing embodiments are merely intended for describingthe technical solutions of the present application, but not for limitingthe present application. Although the present application is describedin detail with reference to the foregoing embodiments, persons ofordinary skill in the art may make modifications to the technicalsolutions described in the foregoing embodiments or make equivalentreplacements to some or all technical features thereof, withoutdeparting from the scope of the present application.

What is claimed is:
 1. An acceleration management node, comprising: amemory configured to store program instructions, and a processor coupledto the memory; wherein, by executing the instructions, the processor isconfigured to: receive, from each acceleration node, information ofacceleration devices on the acceleration node; receive an invocationrequest from a client, wherein the invocation request requests anacceleration device to accelerate a service of the client, and whereinthe invocation request comprises an acceleration requirement; determinea target acceleration device, wherein the information of the targetacceleration device matches the acceleration requirement in theinvocation request; and instruct a target acceleration node, to whichthe target acceleration device belongs, to respond to the invocationrequest; wherein information of an acceleration device on anacceleration node comprises information of an acceleration type, and atleast one of the following: information of an algorithm type,information of an acceleration bandwidth, or non-uniform memory accessarchitecture (NUMA) information.
 2. The acceleration management nodeaccording to claim 1, wherein in determining the target accelerationdevice, the processor is configured to: determine the targetacceleration device, wherein the algorithm type of the targetacceleration device matches an algorithm type indicating by theinvocation request from the client.
 3. The acceleration management nodeaccording to claim 1, wherein the information of an acceleration devicecomprises the information of an acceleration bandwidth, and theacceleration bandwidth comprises a total bandwidth and an occupiedbandwidth; and in determining the target acceleration device, theprocessor is configured to: determine the target acceleration device,wherein a remaining bandwidth of the target acceleration device isgreater than or equal to a target acceleration bandwidth indicating bythe invocation request, wherein the remaining bandwidth is the totalbandwidth minus the occupied bandwidth.
 4. The acceleration managementnode according to claim 3, wherein when there are more than oneacceleration devices that have remaining bandwidths greater than orequal to the target acceleration bandwidth indicating by the invocationrequest, one acceleration device that has a maximum remaining bandwidthis determined to be the target acceleration device.
 5. The accelerationmanagement node according to claim 1, wherein when there are more thanone acceleration devices that meet the acceleration requirement, oneacceleration device having a maximum quantity of virtual functions isdetermined to be the target acceleration device.
 6. The accelerationmanagement node according to claim 1, wherein when there are more thanone acceleration devices that meet the acceleration requirement, oneacceleration device that is first found according to a time sequence ofquerying the information of acceleration devices is determined to be thetarget acceleration devices.
 7. The acceleration management nodeaccording to claim 1, wherein the information of an acceleration devicecomprises the NUMA information; and wherein in determining the targetacceleration device, the processor is configured to: determine thetarget acceleration device, wherein the NUMA information of the targetacceleration device is consistent with NUMA information indicating bythe invocation request.
 8. The acceleration management node according toclaim 1, wherein in instruct the target acceleration node, to which thetarget acceleration device belongs, to respond to the invocationrequest, the processor is configured to: send a configurationinstruction message to the target acceleration node, to instruct thetarget acceleration node to respond to the invocation request; whereinthe configuration instruction message indicates an acceleration type ofthe target acceleration device, and at least one of the followinginformation of the target acceleration device: information of analgorithm type, information of an acceleration bandwidth, or NUMAinformation.
 9. The acceleration management node according to claim 1,wherein the memory is further configured to store the information of theacceleration devices, and the processor is further configured to updatethe information of the acceleration devices stored in the memory orstore an allocation result for the target acceleration device.
 10. Theacceleration management node according to claim 1, wherein the processoris further configured to: receive a release request from the client forreleasing the target acceleration device; and instruct the targetacceleration node to release the target acceleration device.
 11. Theacceleration management node according to claim 9, wherein the processoris further configured to: find the target acceleration device associatedwith the service according to the allocation result stored in the memorywhen detecting that the service of the client becomes abnormal; andinstruct the target acceleration node to release the target accelerationdevice.
 12. A method for managing acceleration resource, performed by anacceleration management node, comprising: receiving, from eachacceleration node, information of acceleration devices on theacceleration node; receiving an invocation request from a client,wherein the invocation request requests an acceleration device toaccelerate a service of the client, and wherein the invocation requestcomprises an acceleration requirement; determining a target accelerationdevice, wherein the information of the target acceleration devicematches the acceleration requirement in the acceleration requirement;and instructing a target acceleration node, to which the targetacceleration device belongs, to respond to the invocation request;wherein information of an acceleration device on an acceleration nodecomprises information of an acceleration type, and at least one of thefollowing: information of an algorithm type, information of anacceleration bandwidth, or non-uniform memory access architecture (NUMA)information.
 13. The method according to claim 12, wherein determiningthe target acceleration device comprises: determining the targetacceleration device, wherein the algorithm type of the targetacceleration device matches an algorithm type indicating by theinvocation request from the client.
 14. The method according to claim12, wherein the information of an acceleration device comprises theinformation of an acceleration bandwidth, and the acceleration bandwidthcomprises a total bandwidth and an occupied bandwidth; and whereindetermining the target acceleration device comprises: determining thetarget acceleration device, wherein a remaining bandwidth of the targetacceleration device is greater than or equal to a target accelerationbandwidth indicating by the invocation request, wherein the remainingbandwidth is the total bandwidth minus the occupied bandwidth.
 15. Themethod according to claim 14, wherein when there are more than oneacceleration devices that have remaining bandwidths greater than orequal to the target acceleration bandwidth indicating by the invocationrequest, one acceleration device that has a maximum remaining bandwidthis determined to be the target acceleration device.
 16. The methodaccording to claim 12, wherein when there are more than one accelerationdevices that meet the acceleration requirement, one acceleration devicehaving a maximum quantity of virtual functions is determined to be thetarget acceleration device.
 17. The method according to claim 12,wherein when there are more than one acceleration devices that meet theacceleration requirement, one acceleration device that is first foundaccording to a time sequence of querying the information of accelerationdevices is determined to be the target acceleration devices.
 18. Themethod according to claim 12, wherein the information of an accelerationdevice comprises the NUMA information; and wherein determining thetarget acceleration device comprises: determining the targetacceleration device, wherein the NUMA information of the targetacceleration device is consistent with NUMA information indicating bythe invocation request.
 19. The method according to claim 12, whereininstructing the target acceleration node, to which the targetacceleration device belongs, to respond to the invocation requestcomprises: sending a configuration instruction message to the targetacceleration node, to instruct the target acceleration node to respondto the invocation request; wherein the configuration instruction messageindicates an acceleration type of the target acceleration device, and atleast one of the following information of the target accelerationdevice: information of an algorithm type, information of an accelerationbandwidth, or NUMA information.
 20. A non-transitory storage medium,storing instructions which, when executed by one or more processors ofan acceleration management device, cause the device to: receive, fromeach acceleration node, information of acceleration devices on theacceleration node; receive an invocation request from a client, whereinthe invocation request requests an acceleration device to accelerate aservice of the client, and wherein the invocation request comprisesacceleration requirement; determine a target acceleration device,wherein the information of the target acceleration device matches theacceleration requirement received from the client; and instruct a targetacceleration node, to which the target acceleration device belongs, torespond to the invocation request; wherein information of anacceleration device on an acceleration node comprises information of anacceleration type, and at least one of the following: information of analgorithm type, information of an acceleration bandwidth, or non-uniformmemory access architecture (NUMA) information.